#ifndef _TC_NETWORK
#define _TC_NETWORK

#include <stdio.h>
#include <tcCommon/tc_common.h>
#include <tcCommon/tc_math.h>

#ifdef __cplusplus
extern "C" 
{
#endif

#pragma warning(disable: 4996)

#define LOGIN_FAILED	0
#define LOGIN_SUCCEED	1

typedef struct {
	int chessman_id;
	tc_vector2 vec;
} tc_chessman_info;

typedef struct {
	BOOL (*tc_callback_select_chessman_event)(int chessman_id);
	void (*tc_callback_shoot_chessman_event)(int chessman_id, tc_vector2 impulse);
	void (*tc_callback_prop_show_event)(int prop_id);
	void (*tc_callback_change_turn_event)();
	void (*tc_callback_adjust_chessman_event)(tc_chessman_info *chessman_info_array);
} tc_callback_game;

tcExport BOOL tc_network_login(char *user_name, void (*tc_callback_login)(int status));
tcExport void tc_network_set_wait_for_player_callback(void (*tc_callback_start_game)());
tcExport void tc_network_get_online_players(void (*tc_callback_user_list)(char **user_list, BOOL *status, int user_count));
tcExport void tc_network_create_connection(char *rival_name);

tcExport void tc_network_set_game_callback(tc_callback_game *callback);

tcExport void tc_network_send_chessman_select_event(int chessman_id);
tcExport void tc_network_send_chessman_shoot_event(int chessman_id, tc_vector2 impulse);
tcExport void tc_network_send_prop_show_event(int prop_id);
tcExport void tc_network_send_change_turn_event();
tcExport void tc_network_send_sync_chessman_event(tc_chessman_info *chessman_info_array);

tcExport BOOL tc_network_is_host();

tcExport BOOL tc_network_has_receive_sync_data();
tcExport void tc_network_set_has_receive_sync_data(BOOL src);

#ifdef __cplusplus
}
#endif

#endif